package ysq.xyg.web.model.po;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 业务模块-活动室预约人员实体类
 *
 * @author shengQiang yu
 * @date 2019-5-15 22:39:34
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_web_area_user")
public class WebAreaUser implements Serializable{

	/**
     * 主键
     */ 
	@Id
	private String id;
	
	/**
     * 活动室id
     */ 
	@Column(name = "area_id")
	private String areaId;
	
	/**
     * 会员id
     */ 
	@Column(name = "member_id")
	private String memberId;
	
	/**
     * 开始日期
     */
	@Excel(name = "开始日期", format = "yyyy-MM-dd HH:mm:ss",orderNum = "2")
	@Column(name = "start_date")
	private Date startDate;
	
	/**
     * 结束时间
     */
	@Excel(name = "结束日期", format = "yyyy-MM-dd HH:mm:ss",orderNum = "3")
	@Column(name = "end_date")
	private Date endDate;
	
	/**
     * 　姓名
     */
	@Excel(name = "姓名",orderNum = "4")
	@Column(name = "user_name")
	private String userName;
	
	/**
     * 手机号
     */
	@Excel(name = "手机号",orderNum = "5")
	@Column(name = "phone")
	private String phone;
	
	/**
     * 身份证
     */
	@Excel(name = "身份证",orderNum = "6")
	@Column(name = "id_card")
	private String idCard;
	
	/**
     * 预约人数
     */
	@Excel(name = "预约人数",orderNum = "7")
	@Column(name = "num")
	private int num;
	
	/**
     * 审核状态:1、待审核，2、审核通过,3、审核未通过
     */
	@Excel(name = "审核状态",replace = { "待审核_1", "审核通过_2", "审核未通过_2"},orderNum = "11")
	@Column(name = "status")
	private String status;
	
	/**
     * 审核时间
     */
	@Excel(name = "审核时间", format = "yyyy-MM-dd HH:mm:ss",orderNum = "12")
	@Column(name = "check_time")
	private Date checkTime;
	
	/**
     * 审核备注
     */
	@Excel(name = "审核备注",orderNum = "13")
	@Column(name = "check_remark")
	private String checkRemark;
	
	/**
     * 删除标注:1、正常，2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;
	
	/**
     * 创建时间
     */
	@Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss",orderNum = "14")
	@Column(name = "create_time")
	private Date createTime;
	
	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;
	
	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	
	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
	 * 星期
	 */
	@Excel(name = "星期",orderNum = "8")
	@Column(name = "week_day")
	private String weekDay;
	/**
	 * 时间：上午、下午、晚上
	 */
	@Excel(name = "时间段",orderNum = "9")
	@Column(name = "time_slot")
	private String timeSlot;
	/**
	 * 教室：1-6号教室
	 */
	@Excel(name = "教室",orderNum = "10")
	@Column(name = "class_room")
	private String classRoom;
	/**
	 * 开始日期
	 */
	@Transient
	private String startDateStr;

	/**
	 * 结束时间
	 */
	@Transient
	private String endDateStr;

	/**
	 * 活动室名称
	 */
	@Transient
	@Excel(name = "活动室名称",orderNum = "1")
	private String areaName;

	public WebAreaUser(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}